home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="utf-8"?>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- ><xsl:output method="html" encoding='iso-8859-1'/>
-
-
- <xsl:template match="/">
-
- <!--The following variable will store the language to be used. Note
- that we are determining the language using the xml:lang attribute -->
- <xsl:variable name="isolang">
- <xsl:value-of select="/employees/@xml:lang"/>
- </xsl:variable>
-
- <!--Generate the path where the heading files are stored. Note how the
- language determines the name of the file that contains the translations -->
- <xsl:variable name="headingpath" select="concat('translations/',$isolang,'/headings.xml')"/>
-
- <META http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-
-
- <xsl:for-each select="employees/employee">
-
- <xsl:for-each select="*">
- <xsl:value-of select="@desc"/>
-
- <xsl:variable name="fieldname" select="name(.)"/>
-
-
- <!-- Look up header using the current element name -->
- <xsl:variable name="fieldheader" select="document ($headingpath)/headings/heading[@category=$fieldname]"/>
-
-
-
- <xsl:value-of select="$fieldheader"/>
- <xsl:element name="input">
-
- <!-- Set the Size of the textbox -->
- <xsl:attribute name="size">
- <xsl:value-of select="@size"/>
- </xsl:attribute>
-
- <!-- Set the value of the text box -->
- <xsl:attribute name="value">
- <xsl:value-of select="text()"/>
- </xsl:attribute>
- <br/>
- </xsl:element>
-
-
- </xsl:for-each>
- </xsl:for-each>
- </xsl:template>
-
- </xsl:stylesheet>
-